package demo3;

public class Test {
    public static void func(Message<?> message) {//通配符
        System.out.println(message.getMessage());
    }

    public static<T> void func1(Message<T> message) {//用泛型方法也可以实现.
        System.out.println(message.getMessage());

    }
    public static void main(String[] args) {
        Message<String> message=new Message<>();
        message.setMessage("02初雪限定");
        func(message);
        func1(message);
        Message<Integer> message1=new Message<>();
        message1.setMessage(100);
        func(message1);
        func1(message1);
    }
}
